<template>
  <div>
    <div class="img-wrap">
      <img :src="goodsData.imgUrl" alt="" />
    </div>
    <div class="content-wrap">
      <div class="price-wrap">
        <div class="price">
           {{ goodsData.price}}
        </div>
        <div class="market-price">{{goodsData.marketPrice}}</div>
      </div>
      <div class="buy-btn">
        立即抢购
      </div>
    </div>
  </div>
</template>

<script  setup>
import { onMounted, computed} from "vue";
import { useRoute } from "vue-router";
import { useHomeStore } from "@/store";

const homeStore = useHomeStore();
const route = useRoute();
const goodsData =computed(()=>homeStore.goodsList.find((item)=>item.goodsId===route.params.goodsId))
onMounted(()=>{

})

</script>

<style lang="less" scoped>
.img-wrap{
    height: 50vw;
    &>img{
        width: 100%;
        height: 100%;
    }
}
</style>